#include<string.h>
#include<stdio.h>
int main()
{
    char a[5000];
    gets(a);
    int t = strlen(a);
    int count = 0;
    for (int i = t; i > 0; i--)
    {
        if (a[i] == ' ')
        {
            --count;
            break;
        }
        else
        {
            count++;
        }
    }
    printf("%d", count);
}